package com.example.uhfc76;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.uhf.R;


import java.util.ArrayList;
import java.util.List;

public class DialogAdapter extends BaseAdapter {
    private LayoutInflater mInflater;
private Context mcontext;
private List<Url> list=new ArrayList();
private TextView tv1,tv2,tv3;

    public DialogAdapter(Context context, List<Url> list){
this.mcontext=context;
        this.mInflater = LayoutInflater.from(context);
this.list=list;
    }
    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        convertView=mInflater.inflate(R.layout.dialog_list,null);
        tv1=convertView.findViewById(R.id.tv1);
        tv2=convertView.findViewById(R.id.tv2);
//        tv3=convertView.findViewById(R.id.tv3);

        tv1.setText(list.get(position).getLocation());
        tv2.setText(list.get(position).getPart_des());
//tv3.setText(list.get(position).getPart_des());

        return convertView;
    }
}
